import request from '@/utils/request'
// 查询字典数据
export const getQueryList = (params) => request({
  url: '/system/dict/data/query',
  method: 'post',
  params,
})
// 查询字典类型列表
export const listType = (params) => request({
  url: '/system/dict/type/query',
  method: 'post',
  data: params,
})

// 根据dict_id查询字典类型
export const getType = (dictId) => request({
  url: '/system/dict/type/query',
  data: { dictId },
  method: 'post',
})

// 新增字典类型
export const addType = (data) => request({
  url: '/system/dict/type/add',
  method: 'post',
  data,
})

// 修改字典类型
export const updateType = (data) => request({
  url: '/system/dict/type/update',
  method: 'post',
  data,
})

// 删除字典类型
export const delType = (dictIds) => request({
  url: '/system/dict/type/delete',
  method: 'post',
  data: { dictIds },
})

// 清理参数缓存
export const clearCache = () => request({
  url: '/dict/type/clearCache',
  method: 'delete',
})

// 获取字典选择框列表
export const optionselect = () => request({
  url: '/system/dict/data/selectDictDataList',
})
// 根据字典编号查询字典数据信息
export function getData(data) {
  return request({
    url: '/system/dict/data/query',
    method: 'post',
    data,
  })
}
